<?php use_helper('Note')?>

<ul class="courses-list by-course">
<?php foreach($courses as $course):?>
	<li>
		<a class="btn_expand" href="#">Expand</a>
		<div class="details">
			<h3><?php echo $course['obj']->getSubject()->getName().' '.$course['obj']->getSection() ?>: <a href="<?php echo url_for('notes/index').'?course_id='.$course['obj']->getId()?>"><?php echo $course['obj']->getName()?></a></h3>
			<p><?php echo sizeof($course['notes'])?> Notes<!-- | Latest Posted on NOV 12, 2008--></p>
			
			<div style="display:none;">
				<ul class="courses-list expanded">
				
				<?php foreach($course['notes'] as $note):?>
					<li>
						<p class="date"><?php echo $note->getUpdatedAt() ? $note->getUpdatedAt('M d, Y') : $note->getCreatedAt('M d, Y') ?></p>
						<h3>
						Lecture <?php echo $note->getNumber() ?> :<?php echo render_note_title_link($note) ?>
						</h3>
						<p class="edit">
							<?php echo link_to('edit', 'notes/edit?id='.$note->getId())?>
							<?php if($note->getUserId() == $sf_user->getId()): ?>
							&nbsp;
								<?php echo link_to('delete', 'notes/delete?id='.$note->getId())?>
							<?php endif ?>
						</p>
						<p><?php echo $note->getSummary()?></p>
					</li>
				<?php endforeach?>
				</ul>		
			</div>
		</div>
	</li>

<?php endforeach?>
</ul>